home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7193 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  737 b 

  1. Path: access1.digex.net!not-for-mail
  2. From: ell@access1.digex.net (Ell)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Virtuals in constructor
  5. Date: 22 Feb 1996 01:58:05 GMT
  6. Organization: The Universe
  7. Message-ID: <4ggijd$931@news4.digex.net>
  8. References: <312A3A72.688D@scopus.ch>
  9. NNTP-Posting-Host: access1.digex.net
  10. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  11.  
  12. Fabienne Guinnard (guinnard_f@scopus.ch) wrote:
  13. : Hi,
  14. : does anyone know why the following code doesn't work ?
  15. : Run-time error: pure virtual function called
  16. : class A
  17. : {
  18. :   public:
  19. :     A(VOID) { Method(); }
  20. :     virtual VOID Method(VOID) = 0;
  21. : };
  22.  
  23. According to the '92 ARM, it is undefined to call a pure virtual function 
  24. of a class from its constructor.
  25.  
  26. Elliott
  27.